package cn.gjxblog.common.exception;

import cn.gjxblog.common.model.HttpResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Author guojiaxun
 * @Date 2019/9/9 17:36
 */
@Slf4j
@RestControllerAdvice
public class ExceptionHandler {

    /**
     * 处理自定义异常
     */
    @org.springframework.web.bind.annotation.ExceptionHandler(CustomMsgException.class)
    public HttpResult handleCustomMsgException(CustomMsgException e){
        return HttpResult.error(e.getMessage());
    }


}
